﻿<!-- This file is part of DesktopGap (http://desktopgap.codeplex.com)
 ! Copyright (c) rubicon IT GmbH, Vienna, and contributors
 ! 
 ! This program is free software; you can redistribute it and/or
 ! modify it under the terms of the GNU General Public License
 ! as published by the Free Software Foundation; either version 2
 ! of the License, or (at your option) any later version.
 ! 
 ! This program is distributed in the hope that it will be useful,
 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ! GNU General Public License for more details.
 ! 
 ! You should have received a copy of the GNU General Public License
 ! along with this program; if not, write to the Free Software
 ! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 !
 ! Additional permissions are listed in the file DesktopGap_exceptions.txt.
 ! 
-->

<TabItem x:Class="DesktopGap.Clients.Windows.WebBrowser.UI.BrowserTab"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" >
    <TabItem.Resources>
        <BitmapImage x:Key="GoButton" UriSource="/DesktopGap;component/Resources/go.png" />
        <BitmapImage x:Key="CloseButton" UriSource="/DesktopGap;component/Resources/close.png" />

    </TabItem.Resources>
    
    <TabItem.Header>
        <DockPanel HorizontalAlignment="Right" 
                   DataContext="{Binding Path=TabHeaderViewModel}">
                   <!--Background="{Binding Path=BackgroundBrush}" >-->
            <!--<Border DockPanel.Dock="Left" BorderThickness="3" BorderBrush="{Binding Path=BackgroundBrush}" Margin="0 0 5 0"  Height="15"/>--> 
            
            <Image Width="16" 
                   Height="16" 
                   Margin="0 -2 0 0" 
                   Source="{Binding Path=Icon}" DockPanel.Dock="Left" />
            
            <Label Margin="0 -4 0 0" DockPanel.Dock="Left" MaxWidth="200" >
                <TextBlock TextTrimming="CharacterEllipsis" Text="{Binding Path=Text, FallbackValue='Loading ...'}" />
            </Label>
            
            <Button Visibility="{Binding Path=CloseButtonVisibility}" 
                    Background="Transparent" 
                    BorderBrush="Transparent" 
                    Padding="1 0 1 0" 
                    FontWeight="Bold"
                    DockPanel.Dock="Right"
                    Command="{Binding Path=CloseCommand}">
                <Image Margin="0 -2 0 0" Width="16" HorizontalAlignment="Right" VerticalAlignment="Center" >
                    <Image.Source>
                        <StaticResource ResourceKey="CloseButton" />
                    </Image.Source>
                </Image>
            </Button>
            
        </DockPanel>
    </TabItem.Header>
    
    <DockPanel>
        <Grid DockPanel.Dock="Top" Visibility="{Binding Path=AddressBarVisibility}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <TextBox Name="urlTextBox" Text="{Binding Path=Url}" KeyDown="OnUrlTextKeyDown" Grid.Column="0" />
        </Grid>
        
        <ContentControl Content="{Binding Path=WebBrowserHost}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  DockPanel.Dock="Top"/>

    </DockPanel>
</TabItem>
